package com.hung.trade.common.constants;

/**
 * @author hungki
 * @createTime 2018-10-08 下午 3:27
 */
public class TradeEnums {
    public enum ShippingStatusEnum{
        NO_SHIP("0","未发货"),SHIPPED("1","已发货"),RECEVIED("2","已收货");
        private String statusCode;
        private String description;
        ShippingStatusEnum(String statusCode,String description){
            this.statusCode = statusCode;
            this.description = description;
        }

        @Override
        public String toString() {
            return "ShippingStatusEnum{" +
                    "statusCode='" + statusCode + '\'' +
                    ", description='" + description + '\'' +
                    '}';
        }

        public String getStatusCode() {
            return statusCode;
        }

        public void setStatusCode(String statusCode) {
            this.statusCode = statusCode;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }
    }
    public enum OrderStatusEnum{
        NO_CONFIRM("0","未确认"),CONFIRM("1","已确认"),CANCEL("2","未确认"),INVALID("3","已确认"),RETURENED("4","已退货");

        public String getStatusCode() {
            return statusCode;
        }

        public void setStatusCode(String statusCode) {
            this.statusCode = statusCode;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        private String statusCode;
        private String description;
        OrderStatusEnum(String statusCode,String description){
            this.statusCode = statusCode;
            this.description = description;
        }

        @Override
        public String toString() {
            return "OrderStatusEnum{" +
                    "statusCode='" + statusCode + '\'' +
                    ", description='" + description + '\'' +
                    '}';
        }
    }
    public enum PayStatusEnum{
        NO_PAY("0","未付款"),PAYING("1","支付中"),PAID("2","已付款");
        private String statusCode;
        private String description;
        PayStatusEnum(String statusCode,String description){
            this.statusCode = statusCode;
            this.description = description;
        }

        public String getStatusCode() {
            return statusCode;
        }

        public void setStatusCode(String statusCode) {
            this.statusCode = statusCode;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        @Override
        public String toString() {
            return "PayStatusEnum{" +
                    "statusCode='" + statusCode + '\'' +
                    ", description='" + description + '\'' +
                    '}';
        }
    }
    public enum RestServerEnum{
        ORDER("localhost","order",8080),PAY("localhost","pay",8081),USER("localhost","user",8086),COUPON("localhost","coupon",8085),GOODS("localhost","goods",8084);


        public String getServerHost() {
            return serverHost;
        }

        public int getServerPort() {
            return serverPort;
        }

        public String getContextPath() {
            return contextPath;
        }

        private String scheme="http://";
        private String serverHost;
        private int serverPort;
        private String contextPath;
        RestServerEnum(String serverHost,String contextPath,int serverPort){
            this.serverHost = serverHost;
            this.serverPort = serverPort;
            this.contextPath = contextPath;
        }
        public String getServerUrl(){
            return (scheme+this.getServerHost()+":"+getServerPort()+"/"+getContextPath()).replace("/+","/");
        }

    }
    public enum RetEnum {

        SUCCESS("1","成功"),FAIL("-1","失败");
        private String code;
        private String desc;

        RetEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }
    public enum YesNoEnum {

        YES("1","是"),NO("0","否");
        private String code;
        private String desc;

        YesNoEnum(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    public enum UserMoneyLogTypeEnum {

        PAID("1","订单付款"),RETURNED("2","订单退款");
        private String code;
        private String desc;

        UserMoneyLogTypeEnum(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }
    public enum OrderTopicAndTagEnum {

        ORDER_CONFIRM("orderTopic","confirm"),ORDER_CANCEL("orderTopic","cancel"),ORDER_PAID("orderTopic","paid");
        private String topic;
        private String tags;

        public String getTopic() {
            return topic;
        }

        public void setTopic(String topic) {
            this.topic = topic;
        }

        public String getTags() {
            return tags;
        }

        public void setTags(String tags) {
            this.tags = tags;
        }

        OrderTopicAndTagEnum(String topic, String tags) {
            this.topic = topic;
            this.tags = tags;
        }


    }


    public enum ConsumerStatusEnums {

        PROCESSING("0","正在处理"),SUCCESS("1","处理成功"),FAIL("2","处理失败");
        private String statusCode;
        private String desc;

        ConsumerStatusEnums(String statusCode,String desc){
            this.statusCode = statusCode;
            this.desc = desc;
        }

        public String getStatusCode() {
            return statusCode;
        }

        public void setStatusCode(String statusCode) {
            this.statusCode = statusCode;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public String toString() {
            return "ConsumerStatusEnums{" +
                    "statusCode='" + statusCode + '\'' +
                    ", desc='" + desc + '\'' +
                    '}';
        }

    }
}
